package cn.edu.sgu.www.mhxysy.dto.chongwu;

import cn.edu.sgu.www.mhxysy.consts.CustomMessages;
import cn.edu.sgu.www.mhxysy.consts.RegExps;
import cn.edu.sgu.www.mhxysy.dto.DataTransferObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;

/**
 * @author 沐雨橙风ιε
 * @version 1.0
 */
@Data
@ApiModel
public class ChongwuDTO implements DataTransferObject {

	@ApiModelProperty(value = "ID")
	private String id;

	/**
	 * 宠物名字
	 */
	@NotBlank(message = "宠物名字" + CustomMessages.NOT_NULL)
	@ApiModelProperty(value = "宠物名字", required = true)
	private String name;

	/**
	 * 资质类型
	 */
	@Positive(message = "资质类型" + CustomMessages.ILLEGAL)
	@NotNull(message = "资质类型" + CustomMessages.NOT_NULL)
	@ApiModelProperty(value = "资质类型", required = true)
	private Integer zizhiType;

	/**
	 * 宠物等级
	 */
	@PositiveOrZero(message = "宠物等级" + CustomMessages.ILLEGAL)
	@NotNull(message = "宠物等级" + CustomMessages.NOT_NULL)
	@ApiModelProperty(value = "宠物等级", required = true)
	private Integer grade;

	/**
	 * 宠物评分
	 */
	@Positive(message = "宠物评分" + CustomMessages.ILLEGAL)
	@NotNull(message = "宠物评分" + CustomMessages.NOT_NULL)
	@ApiModelProperty(value = "宠物评分", required = true)
	private Integer score;

	/**
	 * 宠物寿命
	 */
	@Min(value = 50, message = "宠物寿命" + CustomMessages.ILLEGAL)
	@NotNull(message = "宠物寿命" + CustomMessages.NOT_NULL)
	@ApiModelProperty(value = "宠物寿命", required = true)
	private Integer lifespan;

	/**
	 * 角色ID
	 */
	@Pattern(regexp = RegExps.ROLE_ID, message = "角色ID" + CustomMessages.ILLEGAL)
	@NotBlank(message = CustomMessages.ROLE_ID_NOT_NULL)
	@ApiModelProperty(value = "角色ID", required = true)
	private String roleId;

	/**
	 * 宠物类型ID
	 */
	@Positive(message = "宠物类型ID" + CustomMessages.ILLEGAL)
	@NotNull(message = CustomMessages.CHONGWU_CATEGORY_ID_NOT_NULL)
	@ApiModelProperty(value = "宠物类型ID", required = true)
	private Integer categoryId;
}